package com.abstractfactory;

/**
 * @author sailor wang
 * @date 2018/8/31 上午10:43
 * @description
 */
public class ColorFactory extends AbstractFactory {

    @Override
    public Shape getShape(String shape) {
        return null;
    }

    @Override
    public Color getColor(String color) {
        if (color == null || color.trim().equals("")){
            return null;
        }
        if ("red".equals(color.toLowerCase())){
            return new Red();
        }else if ("green".equals(color.toLowerCase())){
            return new Green();
        }else if ("blue".equals(color.toLowerCase())){
            return new Blue();
        }
        return null;
    }
}